feat(ramps-controller): Transak native order status via Pusher#9541
feat(ramps-controller): Transak native order status via Pusher#9541georgeweiler wants to merge 2 commits into
Conversation
Use Transak public order-ID Pusher channels as wake-ups for pending transak-native orders, then refresh normalized status through the MetaMask on-ramp API. Keep HTTP polling as fallback when disconnected. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Caution MetaMask internal reviewing guidelines:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7b354a1. Configure here.
| this.#transakOrderUpdates.destroy(); | ||
| this.#transakOrderUpdates = null; | ||
| } | ||
|
|
There was a problem hiding this comment.
getOrder skips Pusher subscribe
High Severity
getOrder merges pending Transak Native orders into controller state but never calls the Transak Pusher subscribe helper, unlike addOrder. If order polling is already running, startOrderPolling will not run #ensureTransakOrderSubscriptions again, so those orders never join a Pusher channel and only advance on the 30s HTTP poll.
Reviewed by Cursor Bugbot for commit 7b354a1. Configure here.
| } | ||
| }); | ||
|
|
||
| this.#maybeSubscribeTransakOrder(healedOrder); |
There was a problem hiding this comment.
Terminal updates leave Pusher subscribed
Medium Severity
When a Transak Native order moves to a terminal status via addOrder or getOrder, #maybeSubscribeTransakOrder returns early and does not tear down an existing Pusher subscription. Only #refreshOrder calls #unsubscribeTransakOrder on terminal status, so terminal orders updated outside that path can keep channel listeners until stopOrderPolling.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 7b354a1. Configure here.


Summary
transak-native/transak-native-staging) orders to Transak's public Pusher order-ID channels for real-time status wake-upsORDER_*event, debounce and call existing#refreshOrderso status stays normalized by the MetaMask on-ramp APIpusher-js, exportisTransakNativeProvider/createPusherTransakOrderUpdatesClient, and bump@metamask/ramps-controllerto17.1.0Test plan
yarn workspace @metamask/ramps-controller test(100% coverage)Made with Cursor